home *** CD-ROM | disk | FTP | other *** search
/ Creative Computers / Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso / commercial / legendary_design / addressit! / reqbase.h < prev    next >
C/C++ Source or Header  |  1994-11-17  |  13KB  |  354 lines

  1.  
  2. /* reqlibrary.h © 1988/1989 reserved by Colin Fox and Bruce Dawson */
  3.  
  4. #ifndef REQLIBRARY_H
  5. #define REQLIBRARY_H
  6.  
  7. #define    REQVERSION    1
  8.  
  9.  
  10. #define    NUMPAIRS    10
  11.  
  12. struct GadgetBlock
  13.     {
  14.     struct Gadget        Gadget;
  15.     struct Border        Border;
  16.     WORD                Pairs[NUMPAIRS];
  17.     struct IntuiText    Text;
  18.     };
  19.  
  20. struct StringBlock
  21.     {
  22.     struct Gadget        Gadget;
  23.     struct StringInfo    Info;
  24.     struct Border        Border;
  25.     WORD                Pairs[NUMPAIRS];
  26.     };
  27.  
  28. struct PropBlock
  29.     {
  30.     struct Gadget        Gadget;
  31.     struct PropInfo        Info;
  32.     struct Image        Image;
  33.     };
  34.  
  35. struct ScrollBlock
  36.     {
  37.     struct Gadget        ArrowUpLt;
  38.     struct Image        ImageUpLt;
  39.     struct Gadget        ArrowDnRt;
  40.     struct Image        ImageDnRt;
  41.     struct PropBlock    Prop;
  42.     };
  43.  
  44. struct TwoImageGadget
  45.     {
  46.     struct Gadget        Gadget;
  47.     struct Image        Image1;
  48.     struct Image        Image2;
  49.     };
  50.  
  51. #define    ATTITUDEB    16
  52.  
  53. #define    HORIZSLIDER        (0L<<ATTITUDEB)    /*;which way the slider stands*/
  54. #define    VERTSLIDER        (1L<<ATTITUDEB)    /*;This is so that it bypasses all gadget flags.*/
  55.  
  56.  
  57.  
  58. /*;         This structure is use with the TextRequester function.*/
  59.  
  60. struct TRStructure
  61.     {
  62.     char    *Text;            /* ;This is the message text, including printf() style formatting if desired.*/
  63.     char    *Controls;        /* ;This is the address of the parameter list, if printf() style formatting is used.*/
  64.     struct Window    *Window;/* ;This is an optional (zero if not used) pointer to a window on the screen you*/
  65.                             /* ;would like the requester to show up on.*/
  66.     char    *MiddleText;    /* ;If non-zero, this is the text for the gadget in the lower middle (returns 2).*/
  67.     char    *PositiveText;    /* ;If non-zero, this is the text for the gadget in the lower left hand corner (returns 1).*/
  68.     char    *NegativeText;    /* ;If non-zero, this is the text for the gadget in the lower right (returns 0).*/
  69.     char    *Title;            /* ;This is the title for the window.*/
  70.     WORD    KeyMask;        /* ;This is the qualifier mask for the keyboard shortcuts.*/
  71.                             /* ;Use $FFFF to allow any qualifiers (or none).*/
  72.                             /* ;Zero means that no keyboard shortcuts are allowed.*/
  73.     WORD    textcolor;        /* ;Color of the text.  Uses color 1 if no color specified. */
  74.     WORD    detailcolor;    /* ;Detail and block color, as in a NewWindow structure.  If */
  75.     WORD    blockcolor;        /* ;both are left zero, block pen will be set to 1. */
  76.     WORD    versionnumber;    /* ;Make SURE this is set to zero. */
  77.     LONG    rfu1;            /* ;Make SURE you leave these two zeroed also. */
  78.     LONG    rfu2;            /* ;Make SURE you leave these two zeroed also. */
  79.     };
  80.  
  81. /* NOTE:
  82.  
  83.     The  control  values  mentioned above are used if you choose to insert
  84. printf  style directives in your strings and should contain the address of
  85. a list of control parameters, usually on the stack.
  86.     */
  87.  
  88.  
  89.  
  90. /*;         Remember,   if  you  don't  want  to  go  through  the  hassle  of */
  91. /*; initializing a ExtendedColorRequester structure, you can always just call */
  92. /*; ColorRequester  (as opposed to ExtendedColorRequester).  ColorRequester */
  93. /*; just  takes  a  single  parameter, in D0, the color that should start out */
  94. /*; being highlit.  It returns a single value, the color that was selected at */
  95. /*; the end.
  96.  
  97. /*;         This structure is for use with the ExtendedColorRequester (_not_, */
  98. /*; the ColorRequester) function. */
  99.  
  100. struct ExtendedColorRequester
  101.     {
  102.     LONG    defcolor;        /*;The color that is initially highlit. */
  103.     APTR    window;            /*;The window the 'requester' opens up in. */
  104.     LONG    rfu1;            /*;Who knows what these will be used for, */
  105.     LONG    rfu2;            /*;but I'm sure we'll think of something. */
  106.     LONG    rfu3;            /*;Until then, just keep these zeroed. */
  107.     LONG    rfu4;            /*;Okay? */
  108.     LONG    rfu5;
  109.     };
  110.  
  111.  
  112.  
  113. /*;         This structure is for use with the GetLong function.*/
  114.  
  115. #define    GLNODEFAULTB    0    /*;Set this bit in the flags if you don't want a default*/
  116.                             /*;value to show up in the get long string gadget.  For*/
  117.                             /*;some things this is much better than having a zero*/
  118.                             /*;show up.*/
  119.  
  120. #define    GLNODEFAULTM    (1<<GLNODEFAULTB)
  121.  
  122. struct GetLongStruct
  123.     {
  124.     char    *titlebar;
  125.     LONG    defaultval;
  126.     LONG    minlimit;
  127.     LONG    maxlimit;
  128.     LONG    result;
  129.     struct Window    *window;
  130.     WORD    versionnumber;    /* ;Make SURE this is set to zero. */
  131.     LONG    flags;            /* Some, uh flags.  See above for bit definitions. */
  132.     LONG    rfu2;            /* ;Make SURE you leave these two zeroed also. */
  133.     };
  134.  
  135. struct GetStringStruct
  136.     {
  137.     char    *titlebar;
  138.     char    *stringbuffer;
  139.     struct    Window *window;
  140.     WORD    stringsize;        /* how many characters in the buffer */
  141.     WORD    visiblesize;        /* how many characters show on screen */
  142.     WORD    versionnumber;
  143.     LONG    flags;
  144.     LONG    rfu1;
  145.     LONG    rfu2;
  146.     LONG    rfu3;
  147.     };
  148.  
  149.  
  150.  
  151. #ifndef    DSIZE
  152. #define    DSIZE    130
  153. #define    FCHARS    30
  154. #endif
  155. #define    WILDLENGTH    30
  156.  
  157. #define    FRQSHOWINFOB    0    /*;Set this in Flags if you want .info files to show.  They default to hidden.*/
  158. #define    FRQEXTSELECTB    1    /*;Set this in Flags if you want extended select.  Default is not.*/
  159. #define    FRQCACHINGB        2    /*;Set this in Flags if you want directory caching.  Default is not.*/
  160. #define    FRQGETFONTSB    3    /*;Set this in Flags if you want a font requester rather than a file requester.*/
  161. #define    FRQINFOGADGETB    4    /*;Set this in Flags if you want a hide-info files gadget.*/
  162. #define    FRQHIDEWILDSB    5    /*;Set this in Flags if you DON'T want 'show' and 'hide' string gadgets.*/
  163. #define    FRQABSOLUTEXYB    6    /*;Use absolute x,y positions rather than centering on mouse.*/
  164. #define    FRQCACHEPURGEB    7    /*;Purge the cache whenever the directory date stamp changes if this is set.*/
  165. #define    FRQNOHALFCACHEB    8    /*;Don't cache a directory unless it is completely read in when this is set.*/
  166. #define    FRQNOSORTB        9    /*;Set this in Flags if you DON'T want sorted directories.*/
  167. #define    FRQNODRAGB        10    /*;Set this in Flags if you DON'T want a drag bar and depth gadgets.*/
  168. #define    FRQSAVINGB        11    /*;Set this bit if you are selecting a file to save to.*/
  169. #define    FRQLOADINGB        12    /*;Set this bit if you are selecting a file(s) to load from.*/
  170.                             /*;These two bits (save and load) aren't currently used for*/
  171.                             /*;anything, but they may be in the future, so you should*/
  172.                             /*;remember to set them.  Also, these bits make it easier if*/
  173.                             /*;somebody wants to customize the file requester for their*/
  174.                             /*;machine.  They can make it behave differently for loading*/
  175.                             /*;vs saving.*/
  176. #define    FRQDIRONLYB        13    /*;Allow the user to select a directory, rather than a file.*/
  177.  
  178. #define    FRQSHOWINFOM    (1<<FRQSHOWINFOB)
  179. #define    FRQEXTSELECTM    (1<<FRQEXTSELECTB)
  180. #define    FRQCACHINGM        (1<<FRQCACHINGB)
  181. #define    FRQGETFONTSM    (1<<FRQGETFONTSB)
  182. #define    FRQINFOGADGETM    (1<<FRQINFOGADGETB)
  183. #define    FRQHIDEWILDSM    (1<<FRQHIDEWILDSB)
  184. #define    FRQABSOLUTEXYM    (1<<FRQABSOLUTEXYB)
  185. #define    FRQCACHEPURGEM    (1<<FRQCACHEPURGEB)
  186. #define    FRQNOHALFCACHEM    (1<<FRQNOHALFCACHEB)
  187. #define    FRQNOSORTM        (1<<FRQNOSORTB)
  188. #define    FRQNODRAGM        (1<<FRQNODRAGB)
  189. #define    FRQSAVINGM        (1<<FRQSAVINGB)
  190. #define    FRQLOADINGM        (1<<FRQLOADINGB)
  191. #define    FRQDIRONLYM        (1<<FRQDIRONLYB)
  192.  
  193. struct ESStructure
  194.     {
  195.     struct ESStructure    *NextFile;
  196.     WORD    NameLength;            /* Length of thefilename field, not including the terminating zero. */
  197.     WORD    Pad;
  198.     APTR    Node;                /* For internal use only. */
  199.     char    thefilename[1];        /* This is a variable size field. */
  200.     };
  201.  
  202. struct FileRequester
  203.     {
  204.     UWORD    VersionNumber;                /* Make sure this is zeroed for now. */
  205.  
  206.     char    *Title;                        /* Hailing text */
  207.     char    *Dir;                        /* Directory array (DSIZE+1) */
  208.     char    *File;                        /* Filename array (FCHARS+1) */
  209.  
  210.     char    *PathName;                    /* Complete path name array (DSIZE+FCHARS+2) */
  211.  
  212.     struct Window    *Window;            /* Window requesting or NULL */
  213.  
  214.  
  215.     UWORD    MaxExtendedSelect;            /* Zero implies a maximum of 65535, as long as FRQEXTSELECT is set.*/
  216.     UWORD    numlines;                    /* Number of lines in file window. */
  217.     UWORD    numcolumns;                    /* Number of columns in file window. */
  218.     UWORD    devcolumns;
  219.     ULONG    Flags;                        /* Various - umm - flags.  See above for more info. */
  220.     UWORD    dirnamescolor;            /* These five colors will all default */
  221.     UWORD    filenamescolor;            /* to color one if you don't specify */
  222.     UWORD    devicenamescolor;        /* a color (ie; if you specify color zero). */
  223.     UWORD    fontnamescolor;            /* If you want color zero to be used, specify */
  224.     UWORD    fontsizescolor;            /* color 32, or some other too large number */
  225.                                     /* which mods down to zero. */
  226.  
  227.     UWORD    detailcolor;            /* If both of these colors are specified a